<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <h:body>
	<h:form>  
	    <p:growl id="messages"/>
	    <p:menubar>
		<p:menuitem value="Home" url="/" ajax="false" />
                <p:menuitem value="Create event" action="#{eventController.prepareEventCreate}" ajax="false" rendered="#{request.isUserInRole('admin') or request.isUserInRole('user')}" />
		<p:menuitem value="Sign up" url="/faces/register.xhtml" ajax="false" rendered="#{!request.isUserInRole('admin') and !request.isUserInRole('user')}" />
		<p:menuitem value="Log in" url="/faces/login.xhtml" ajax="false" rendered="#{!request.isUserInRole('admin') and !request.isUserInRole('user')}" />
		<p:menuitem value="Profile" url="/faces/user/profileView.xhtml" ajax="false" rendered="#{request.isUserInRole('admin') or request.isUserInRole('user')}" />
		<p:menuitem value="Invitations" url="/faces/user/invitationView.xhtml" ajax="false" rendered="#{request.isUserInRole('admin') or request.isUserInRole('user')}" />
		<p:menuitem value="Log out" actionListener="#{logoutBean.logout()}" ajax="false" rendered="#{request.isUserInRole('admin') or request.isUserInRole('user')}" />
		
		<f:facet name="options">
		    <p:inputText style="margin-right:10px" value="#{eventController.searchedInput}" placeholder="Search" rendered="#{request.isUserInRole('admin') or request.isUserInRole('user')}" />
		    <p:commandButton type="submit" icon="ui-icon-search" action="#{eventController.searchByEventName()}" ajax="false" rendered="#{request.isUserInRole('admin') or request.isUserInRole('user')}" />
		</f:facet>
	    </p:menubar>
	</h:form>
    </h:body>
</html>